package com.dm.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.dm.dao.DmUserLinkUserMapper;
import com.dm.pojo.DmUserLinkUser;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by dm
 */
@RestController
public class RestDmUserLinkUserService {

     @Autowired
     private DmUserLinkUserMapper dmUserLinkUserMapper;

     @RequestMapping(value = "/getDmUserLinkUserById",method = RequestMethod.POST)
     public DmUserLinkUser getDmUserLinkUserById(@RequestParam("id") Long id)throws Exception{
        return dmUserLinkUserMapper.getDmUserLinkUserById(id);
     }

     @RequestMapping(value = "/getDmUserLinkUserListByMap",method = RequestMethod.POST)
     public List<DmUserLinkUser>	getDmUserLinkUserListByMap(@RequestParam Map<String,Object> param)throws Exception{
        return dmUserLinkUserMapper.getDmUserLinkUserListByMap(param);
     }

     @RequestMapping(value = "/getDmUserLinkUserCountByMap",method = RequestMethod.POST)
     public Integer getDmUserLinkUserCountByMap(@RequestParam Map<String,Object> param)throws Exception{
        return dmUserLinkUserMapper.getDmUserLinkUserCountByMap(param);
     }

     @RequestMapping(value = "/qdtxAddDmUserLinkUser",method = RequestMethod.POST)
     public Integer qdtxAddDmUserLinkUser(@RequestBody DmUserLinkUser dmUserLinkUser)throws Exception{
        dmUserLinkUser.setCreatedTime(new Date());
        return dmUserLinkUserMapper.insertDmUserLinkUser(dmUserLinkUser);
     }

     @RequestMapping(value = "/qdtxModifyDmUserLinkUser",method = RequestMethod.POST)
     public Integer qdtxModifyDmUserLinkUser(@RequestBody DmUserLinkUser dmUserLinkUser)throws Exception{
        dmUserLinkUser.setUpdatedTime(new Date());
        return dmUserLinkUserMapper.updateDmUserLinkUser(dmUserLinkUser);
     }
}
